#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <cv.h>
#include <highgui.h>
#include <QThread>
#include <QImage>

class MyThread : public QThread
{
    Q_OBJECT

public:
    MyThread(QObject *parent = 0);
    ~MyThread();

    void stop();
    void openCamara();
    void readFrame();
    void closeCamara();

signals:
    void renderedImage(const QImage &image);

protected:
    void run();

private:
    bool stopped;
    CvCapture* cam;
public:
    IplImage* frame;
};

#endif // MYTHREAD_H
